package com.ervanalb.cellradio.shared.communicator.packets;

import java.nio.ByteBuffer;

public class AuthenticatePacketData {
	public String username;
	
	public AuthenticatePacketData(ByteBuffer bb)
	{
		username=PacketData.getString(bb);
	}
	
	public int size()
	{
		return PacketData.strlen(username);
	}

	public AuthenticatePacketData(String username) {
		this.username=username;
	}
	
	public PacketData pack()
	{
		ByteBuffer bb=ByteBuffer.allocate(size());
		PacketData.putString(bb,username);
		bb.rewind();
		return new PacketData(PacketData.TYPE_AUTHENTICATE,bb);
	}
}
